Skip to content

Conversation

@krystophny
Copy link
Collaborator

Summary

Fixes issue #380 where ylabels were not rotating 90 degrees counter-clockwise as expected.

Root Cause

The rotate_bitmap_90_ccw and rotate_bitmap_90_cw functions in fortplot_bitmap.f90 had their implementations backwards. When the ylabel rendering code called rotate_bitmap_90_ccw to rotate text 90 degrees counter-clockwise, it was actually getting a clockwise rotation.

Solution

Swapped the transformation logic in both rotation functions so that:

  • rotate_bitmap_90_ccw: Now correctly rotates counter-clockwise using transform (i,j) → (j, width-i+1)
  • rotate_bitmap_90_cw: Now correctly rotates clockwise using transform (i,j) → (height-j+1, i)

Testing

Added comprehensive tests:

  • test_rotation_debug.f90: Visual debugging of rotation transformations
  • test_ylabel_rotation_fix.f90: Basic ylabel rendering test
  • test_ylabel_rotation_regression.f90: Comprehensive test with rotation logic verification

All existing ylabel tests pass after the fix.

Fixes #380

…mplementations

The rotate_bitmap_90_ccw and rotate_bitmap_90_cw functions had their
implementations backwards, causing ylabels to rotate incorrectly.
This fix swaps the transformation logic so that:
- CCW rotation properly rotates counter-clockwise (for ylabel)
- CW rotation properly rotates clockwise

Added comprehensive tests to verify rotation logic and ylabel rendering.

Fixes #380
@codecov
Copy link

codecov bot commented Aug 26, 2025

Codecov Report

❌ Patch coverage is 0% with 78 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
test/test_ylabel_rotation_regression.f90 0.00% 44 Missing ⚠️
test/test_rotation_debug.f90 0.00% 19 Missing ⚠️
test/test_ylabel_rotation_fix.f90 0.00% 15 Missing ⚠️

📢 Thoughts on this report? Let us know!

@krystophny krystophny merged commit b126700 into main Aug 26, 2025
4 of 5 checks passed
@krystophny krystophny deleted the fix-critical-ci-test-failures-382 branch August 26, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regrrssion: ylabel not rotates 90 degrees

2 participants